<script>
  const arr = [1, 2, 3, 4, 5]
  console.dir(arr) //Prototype上有个Symbol.iterator属性
  //   获取并调用数组内建的迭代器方法
  const itr = arr[Symbol.iterator]()
  console.log(itr.next()) // {value: 1, done: false}
  console.log(itr.next()) // {value: 2, done: false}
  console.log(itr.next()) // {value: 3, done: false}
  console.log(itr.next()) // {value: 4, done: false}
  console.log(itr.next()) // {value: 5, done: false}
  console.log(itr.next()) // {value: undefined, done: true}
  console.log(itr.next()) // {value: undefined, done: true}
</script>
